<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    let obj = {
        a: 1,
        b: 2
    }
    
    // let obj2 = {
    //     ...obj,
    //     c: 3,
    //     d: 4
    // }

    // console.log(obj2);
    
    // let {a, b, ...c} = obj2;
    // console.log(a, b, c);
    
    // let obj2 = obj;
    // obj2.a = 10;
    // console.log(obj); // {a: 10, b: 2}

    let obj2 = {...obj};
    obj2.a = 10;
    console.log(obj); // {a: 1, b: 2}
    console.log(obj2); // {a: 10, b: 2}
</script>
</body>
</html>
